<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
      <!-- <el-form-item label="样衣申请ID" prop="sampleTalentApplyId">
        <el-input v-model="queryParams.sampleTalentApplyId" placeholder="请输入样衣申请ID" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="达人信息表ID" prop="sampleTalentInfoId">
        <el-input v-model="queryParams.sampleTalentInfoId" placeholder="请输入达人信息表ID" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="笔记/直播合作ID" prop="sampleTalentCooperateId">
        <el-input v-model="queryParams.sampleTalentCooperateId" placeholder="请输入笔记/直播合作ID" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="联系方式ID" prop="contactId">
        <el-input v-model="queryParams.contactId" placeholder="请输入联系方式ID" clearable @keyup.enter.native="handleQuery" />
      </el-form-item> -->
      <el-form-item label="" prop="xhsNickname">
        <el-input v-model="queryParams.xhsNickname" placeholder="昵称" clearable @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="" prop="productNo">
        <!-- <el-input
          v-model="queryParams.productNo"
          placeholder="合作款式"
          clearable
          @keyup.enter.native="handleQuery"
        /> -->
        <el-select v-model="queryParams.productNo" clearable filterable remote :remote-method="getData"
          placeholder="合作款式">
          <el-option v-for="item in productNooptions" :key="item" :label="item" :value="item">
          </el-option>
        </el-select>
      </el-form-item>
      <!-- -sample_talent_contact表的id -->
      <el-form-item label="" prop="returnContactId">
        <el-input v-model="queryParams.returnContactId" placeholder="请输入退货联系方式" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="" prop="returnExpressPickupCode">
        <el-input v-model="queryParams.returnExpressPickupCode" placeholder="请输入退货取件码" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="" prop="returnExpressNumber">
        <el-input v-model="queryParams.returnExpressNumber" placeholder="请输入快递号" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item>
      <el-form-item label="" prop="returnDate">
        <el-date-picker clearable v-model="queryParams.returnDate" type="date" value-format="yyyy-MM-dd"
          placeholder="请选择退货时间">
        </el-date-picker>
      </el-form-item>
      <!-- <el-form-item label="逻辑删除;0=未删除；1=已删除" prop="isDelete">
        <el-input v-model="queryParams.isDelete" placeholder="请输入逻辑删除;0=未删除；1=已删除" clearable
          @keyup.enter.native="handleQuery" />
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
      <br />
      <el-form-item>
        <el-radio-group v-model="state" size="small" fill="#66b1ff" @change="changeState">
          <el-radio :label="1">我的申请</el-radio>
          <el-radio :label="0">所有记录</el-radio>
        </el-radio-group>
      </el-form-item>
      <br />
      <el-form-item label="" prop="returnStatus">
        <el-radio-group v-model="queryParams.returnStatus" size="small" @change="changeTheme" fill="#66b1ff">
          <el-radio :label="null">所有状态</el-radio>
          <el-radio :label="'returning'">退货中</el-radio>
          <el-radio :label="'canceled'">已取消</el-radio>
          <el-radio :label="'returned'">已退样</el-radio>
          <el-radio :label="'to_returned'">待退货</el-radio>
          <el-radio :label="'cancel_return'">未收到</el-radio>
          <!-- <el-radio :label="'end'">结束</el-radio> -->
          <!-- <el-radio :label="'supervisor_approval'">待审核</el-radio> -->
        </el-radio-group>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <!-- <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
          v-hasPermi="['product:sampleReturn:add']">新增</el-button>
      </el-col> -->
      <!-- <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
          v-hasPermi="['product:sampleReturn:edit']">修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
          v-hasPermi="['product:sampleReturn:remove']">删除</el-button>
      </el-col> -->
      <el-col :span="1.5">
        <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
          v-hasPermi="['product:sampleReturn:export']">导出</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" plain size="mini" @click="handlecheckReturningOrder"
          v-hasPermi="['product:sampleReturn:checkReturningOrder']">售后单检测</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" plain size="mini" @click="handleaftersaleNoInfoUpload"
          v-hasPermi="['product:sampleReturn:upload']">上传售后单号信息</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button size="mini" plain @click="ToDoapply">单品取消</el-button>
      </el-col>

      <!-- <el-col :span="1.5">
        <el-button size="mini" plain @click="Cancel">整单取消</el-button>
      </el-col> -->
      <!-- <el-col :span="1.5">
        <el-button type="primary" size="mini" plain @click="openIDList = true">补录</el-button>
      </el-col> -->
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-dialog :visible.sync="openIDList" append-to-body title="补录" width="1500px" v-if="openIDList">
      <IDList />
    </el-dialog>
    <div ref="tableDom">
      <el-table v-loading="loading" :maxHeight="sampleReturnList.length ? tableHeight : 'auto'" :data="sampleReturnList"
        @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" align="center" />
        <!-- <el-table-column label="退货ID" align="center" prop="id" />
      
      <el-table-column label="达人信息表ID" align="center" prop="sampleTalentInfoId" />
      <el-table-column label="笔记/直播合作ID" align="center" prop="sampleTalentCooperateId" />
      <el-table-column label="合作类型，笔记=note;直播=live" align="center" prop="sampleTalentCooperateType" /> 
      <el-table-column label="联系方式ID" align="center" prop="contactId" />
    
    ,退货中=turning,已退货=turned -sample_talent_contact表的id
    -->
        <el-table-column label="申请人" align="center" prop="userName" width="150" />
        <el-table-column label="平台名称" align="center" prop="platform" />
        <el-table-column label="昵称" align="center" prop="xhsNickname" width="180" />
        <el-table-column label="合作款式" align="center" prop="productNo" width="110" />
        <el-table-column label="款式主图" align="center" prop="picUrl" width="110">
          <!-- <template slot-scope="scope">
            <image-preview :src="scope.row.picUrl" :width="50" :height="50" />
          </template> -->
          <template #default="scope">
            <image-preview :src="scope.row.picUrl" :width="80" :height="80" />
            <!-- <el-popover
              effect="light"
              trigger="click"
              placement="right"
              width="auto"
              v-if="scope.row.picUrl"
            >
              <template #default>
                <img
                  :src="pjtUrl + scope.row.picUrl"
                  style="width: 800px; height: 600px; object-fit: contain"
                  lazy
                />
              </template>
              <template #reference>
                <img
                  :src="pjtUrl + scope.row.picUrl"
                  style="object-fit: contain; width: 80px; height: 80px"
                  lazy
                />
              </template>
            </el-popover> -->
          </template>
        </el-table-column>
        <el-table-column label="商品编码" align="center" prop="productCode" width="150" />
        <el-table-column label="颜色属性" align="center" prop="colorProperty" width="150" />
        <el-table-column label="尺寸" align="center" prop="size" />
        <!-- <el-table-column label="样衣申请ID" align="center" prop="sampleTalentApplyId" /> -->

        <el-table-column label="退货数量" align="center" prop="returnNum" />
        <el-table-column label="退货方式" align="center" prop="returnMethod">
          <template slot-scope="scope">
            <div>
              {{ scope.row.returnMethod | state1 }}
            </div>
          </template>
        </el-table-column>
        <!-- <el-table-column label="退货取件码" align="center" prop="returnExpressPickupCode" width="150" /> -->
        <el-table-column label="退货状态" align="center" prop="returnStatus">
          <template slot-scope="scope">
            <div>
              {{ scope.row.returnStatus | state2 }}
            </div>
          </template>
        </el-table-column>
        <el-table-column label="快递状态" align="center" prop="expressStatus"></el-table-column>
        <el-table-column label="退货联系方式" align="center" prop="returnPhone" width="110" />

        <!-- <el-table-column label="快递号" align="center" prop="returnExpressNumber" /> -->
        <el-table-column label="退货申请时间" align="center" prop="createTime" width="180">
          <!-- <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
        </template> -->
        </el-table-column>
        <el-table-column label="退货收到时间" align="center" prop="returnDate" width="180">
          <!-- <template slot-scope="scope">
          <span>{{ parseTime(scope.row.returnDate, '{y}-{m}-{d}') }}</span>
        </template> -->
        </el-table-column>
        <!-- <el-table-column label="退货收到时间" align="center" prop="returnReceivedDate" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.returnReceivedDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column> -->
        <el-table-column label="退货快递公司" align="center" prop="returnExpressCompany" width="120" />
        <el-table-column label="退货快递编码" align="center" prop="returnExpressCompanyNo" width="150">
          <template slot-scope="scope">
            <el-popover trigger="hover" placement="bottom" width="300">
              <el-input v-model="scope.row.returnExpressCompanyNo" :min-height="192" type="textarea"
                :autosize="{ minRows: 2, maxRows: 24 }" :style="{ width: '100%' }" :disabled="true" />
              <div slot="reference">
                <span class="textname">{{ scope.row.returnExpressCompanyNo }}
                </span>
              </div>
            </el-popover>
          </template>
        </el-table-column>
        <el-table-column label="退货快递号" align="center" prop="returnExpressNumber" width="150">
          <template slot-scope="scope">
            <el-popover trigger="hover" placement="bottom" width="300">
              <el-input v-model="scope.row.returnExpressNumber" :min-height="192" type="textarea"
                :autosize="{ minRows: 2, maxRows: 24 }" :style="{ width: '100%' }" :disabled="true" />
              <div slot="reference">
                <span class="textname">{{ scope.row.returnExpressNumber }}
                </span>
              </div>
            </el-popover>
          </template>
        </el-table-column>

        <el-table-column width="150" label="聚水潭售后单" align="center" prop="jstAsid" />
        <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
            v-hasPermi="['product:sampleReturn:edit']">修改</el-button>
          <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
            v-hasPermi="['product:sampleReturn:remove']">删除</el-button>
        </template>
      </el-table-column> -->
      </el-table>
    </div>

    <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
      @pagination="getList" />

    <!-- 添加或修改样衣退货记录对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="样衣申请ID" prop="sampleTalentApplyId">
          <el-input v-model="form.sampleTalentApplyId" placeholder="请输入样衣申请ID" />
        </el-form-item>
        <el-form-item label="达人信息表ID" prop="sampleTalentInfoId">
          <el-input v-model="form.sampleTalentInfoId" placeholder="请输入达人信息表ID" />
        </el-form-item>
        <el-form-item label="笔记/直播合作ID" prop="sampleTalentCooperateId">
          <el-input v-model="form.sampleTalentCooperateId" placeholder="请输入笔记/直播合作ID" />
        </el-form-item>
        <el-form-item label="联系方式ID" prop="contactId">
          <el-input v-model="form.contactId" placeholder="请输入联系方式ID" />
        </el-form-item>
        <el-form-item label="退货数量" prop="returnNum">
          <el-input v-model="form.returnNum" placeholder="请输入退货数量" />
        </el-form-item>
        <el-form-item label="退货联系方式-sample_talent_contact表的id" prop="returnContactId">
          <el-input v-model="form.returnContactId" placeholder="请输入退货联系方式-sample_talent_contact表的id" />
        </el-form-item>
        <el-form-item label="退货取件码" prop="returnExpressPickupCode">
          <el-input v-model="form.returnExpressPickupCode" placeholder="请输入退货取件码" />
        </el-form-item>
        <el-form-item label="快递号" prop="returnExpressNumber">
          <el-input v-model="form.returnExpressNumber" placeholder="请输入快递号" />
        </el-form-item>
        <el-form-item label="退货时间" prop="returnDate">
          <el-date-picker clearable v-model="form.returnDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择退货时间">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="逻辑删除;0=未删除；1=已删除" prop="isDelete">
          <el-input v-model="form.isDelete" placeholder="请输入逻辑删除;0=未删除；1=已删除" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {
  listTemplate,
  getTemplate,
  delTemplate,
  addTemplate,
  updateTemplate,
  addTemplateAndSecondry,
  addProNoColorSize,
  productNoLike,
} from "@/api/product/template";
import { getInfo } from "@/api/login.js";
import {
  listSampleReturn,
  getSampleReturn,
  delSampleReturn,
  addSampleReturn,
  updateSampleReturn,
  BorderOfficialCancel,
  BorderOfficialCancelALL,
  checkReturningOrder,
  aftersaleNoInfoUpload,
} from "@/api/sample/sampleReturn";
import IDList from '@/views/sample/sampleApply/IDList.vue'

export default {
  name: "SampleReturn",
  components: {
    IDList,
  },
  data() {
    return {
      openIDList: false,
      productNooptions: [],
      userId: "",
      //我的申请
      state: 1,
      //选中
      username: [],
      to_apply: [],

      tableHeight: "",
      pjtUrl: process.env.VUE_APP_BASE_API,
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 样衣退货记录表格数据
      sampleReturnList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        sampleTalentApplyId: null,
        sampleTalentInfoId: null,
        sampleTalentCooperateId: null,
        sampleTalentCooperateType: null,
        contactId: null,
        returnNum: null,
        returnStatus: null,
        returnContactId: null,
        returnExpressPickupCode: null,
        returnExpressNumber: null,
        returnDate: null,
        isDelete: null,
        createBy: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        sampleTalentInfoId: [
          { required: true, message: "达人信息表ID不能为空", trigger: "blur" },
        ],
      },
    };
  },
  created() {
    //  this.queryParams.createBy = "";
    if (this.$route.query.id) {
      this.queryParams.sampleTalentApplyId = this.$route.query.id;
      // this.$set(this.queryParams, "sampleTalentApplyId", this.$route.query.id);
      this.$set(this.queryParams, "createBy", "");
      this.state = 0;
    }
    // this.getList();
    this.getroles();
  },
  mounted() {
    var _this = this;
    this.resizeTable();
    window.onresize = function () {
      _this.resizeTable();
    };
  },
  //记得清空  如果在keepalive中 则使用activated  deactivated
  destroyed() {
    window.onresize = null;
  },
  filters: {
    state1(string) {
      if (string == "pickup") {
        return "上门取件";
      }
      if (string == "selfsending") {
        return "自行寄出";
      }
    },
    state2(string) {
      if (string == "to_returned") {
        return "待退货";
      }
      if (string == "returning") {
        return "退货中";
      }
      if (string == "part_returned") {
        return "部分退样";
      }
      if (string == "returned") {
        return "已退样";
      }
      if (string == "not_return") {
        return "不归还";
      }
      if (string == "cancel_return") {
        return "未收到";
      }
      if (string == "end") {
        return "结束";
      }
      if (string == "canceled") {
        return "已取消";
      }
      // if (int == 2) { return "审批通过" };
    },
  },
  methods: {
    handlecheckReturningOrder() {
      if (this.ids.length < 1) {
        this.$modal.msgError("请至少选择一条数据");
        return;
      }
      this.openLoading();
      checkReturningOrder(this.ids).then((response) => {
        this.$modal.closeLoading();
        if (response.code == 200) {
          this.$modal.msgSuccess("检测成功");
          this.getList();
        }
      });
    },
    handleaftersaleNoInfoUpload() {
      if (this.ids.length < 1) {
        this.$modal.msgError("请至少选择一条数据");
        return;
      }
      this.openLoading();
      aftersaleNoInfoUpload(this.ids).then((response) => {
        this.$modal.closeLoading();
        if (response.code == 200) {
          this.$modal.msgSuccess("上传成功");
          this.getList();
        }
      });
    },
    /* 获取货号列表 */
    getData(key) {
      console.log(JSON.stringify(key));

      // return
      productNoLike(key).then((res) => {
        this.productNooptions = res.data;
        // console.log(JSON.stringify(this.options));
      });
    },
    //根据当前用户id获取数据
    getroles() {
      // var userId = null
      getInfo().then((res) => {
        console.log(JSON.stringify(res));
        // this.applyname = res.user.dept.deptName + '-' + res.user.nickName

        this.userId = res.user.userId.toString();
        this.changeState(1);
      });
    },
    //我的申请
    changeState(val) {
      this.queryParams.pageNum = 1;
      // this.openCheck = false;
      console.log(val);
      console.log(this.userId);
      if (val == 1) {
        // selectMySampleTalentApply({ userId: this.userId, applyStatus: this.queryParams.applyStatus }).then(res => {
        //   this.sampleApplyList = res.data
        // })
        this.queryParams.createBy = this.userId;
        // this.queryParams.applyId = this.userId;
        this.getList();
      } else if (val == 0) {
        this.queryParams.createBy = "";
        this.getList();
      }
    },
    Cancel() {
      if (this.ids.length == 1) {
        const id = this.ids[0];
        this.$modal
          .confirm("是否取消上门取件？整单取消的同时，系统会取消上门取件")
          .then(function () {
            console.log(1111);
            return BorderOfficialCancelALL(id);
          })
          .then((res) => {
            if (res.code == 200) {
              this.$modal.msgSuccess(res.msg);
              this.getList();
            }
          })
          .catch(() => { });
        // this.Visibleapply = true
        // BorderOfficialCancelALL({ id: this.ids[0] }).then((res) => {
        //   if (res.code == 200) {
        //     this.$modal.msgSuccess(res.msg);
        //     this.getList();
        //   }
        // });
      } else {
        // this.Visibleapply = false
        this.$modal.msgError("请选择一条申请记录信息！");
        return;
      }
    },
    // 打开加载层
    openLoading() {
      this.$modal.loading("正在加载，请稍候！");
    },
    //判断是否打开申请
    ToDoapply() {
      // if (this.to_apply.length == 1 && this.to_apply[0] == 'to_returned') {
      if (this.username.length == 1) {
        // this.Visibleapply = true
        this.openLoading();
        BorderOfficialCancel(this.ids).then((res) => {
          this.$modal.closeLoading();
          if (res.code == 200) {
            this.$modal.msgSuccess(res.msg);
            this.getList();
          }
        });
      } else {
        // this.Visibleapply = false
        this.$modal.msgError("请选择同一个达人申请记录信息！");
        return;
      }

      // } else {
      //   // this.Visibleapply = false
      //   this.$modal.msgError('订单处于 “非待退货”状态，暂不可申请。')
      //   return
      // }
    },
    changeTheme() {
      this.getList();
    },
    /** 查询样衣退货记录列表 */
    getList() {
      if (this.$route.query.id) {
        if (this.state == 0) {
          this.queryParams.createBy = "";
        } else {
          this.queryParams.createBy = this.userId;
        }
      }
      this.loading = true;
      listSampleReturn(this.queryParams).then((response) => {
        this.sampleReturnList = response.rows;
        console.log(JSON.stringify(this.sampleReturnList));
        this.total = response.total;
        this.loading = false;
      });
    },
    // table自动高度
    returnTableHeight(ref, bottomOffset) {
      let height = null;
      height =
        window.innerHeight - ref.getBoundingClientRect().top - bottomOffset;
      return height;
    },
    resizeTable() {
      this.$nextTick(() => {
        this.tableHeight = this.returnTableHeight(this.$refs.tableDom, 100);
      }, 0);
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        sampleTalentApplyId: null,
        sampleTalentInfoId: null,
        sampleTalentCooperateId: null,
        sampleTalentCooperateType: null,
        contactId: null,
        returnNum: null,
        returnStatus: null,
        returnContactId: null,
        returnExpressPickupCode: null,
        returnExpressNumber: null,
        returnDate: null,
        isDelete: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.queryParams = {};
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
      var username = selection.map((item) => item.xhsNickname);
      console.log(JSON.stringify(username));
      this.username = Array.from(new Set(username));
      var to_apply = selection.map((item) => item.returnStatus);
      console.log(JSON.stringify(to_apply));
      this.to_apply = Array.from(new Set(to_apply));

      console.log(JSON.stringify(this.to_apply));
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加样衣退货记录";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids;
      getSampleReturn(id).then((response) => {
        this.form = response.data;
        this.open = true;
        this.title = "修改样衣退货记录";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate((valid) => {
        if (valid) {
          if (this.form.id != null) {
            updateSampleReturn(this.form).then((response) => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addSampleReturn(this.form).then((response) => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal
        .confirm('是否确认删除样衣退货记录编号为"' + ids + '"的数据项？')
        .then(function () {
          return delSampleReturn(ids);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => { });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download(
        "product/sampleReturn/export",
        {
          ...this.queryParams,
        },
        `sampleReturn_${new Date().getTime()}.xlsx`
      );
    },
  },
};
</script>
